<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.1"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>AIfES 2: ailayer_dense.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/x-mathjax-config">
  MathJax.Hub.Config({
    extensions: ["tex2jax.js"],
    jax: ["input/TeX","output/HTML-CSS"],
});
</script>
<script type="text/javascript" async="async" src="https://cdn.jsdelivr.net/npm/mathjax@2/MathJax.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="AIfES_logo_small.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">AIfES 2
   &#160;<span id="projectnumber">2.0.0</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.1 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('ailayer__dense_8h_source.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">ailayer_dense.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="ailayer__dense_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160; </div>
<div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;<span class="preprocessor">#ifndef AILAYER_DENSE</span></div>
<div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;<span class="preprocessor">#define AILAYER_DENSE</span></div>
<div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160; </div>
<div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="aifes__core_8h.html">core/aifes_core.h</a>&quot;</span></div>
<div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="aimath__f32__default_8h.html">basic/default/aimath/aimath_f32_default.h</a>&quot;</span></div>
<div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="aimath__q7__default_8h.html">basic/default/aimath/aimath_q7_default.h</a>&quot;</span></div>
<div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="aimath__q31_8h.html">basic/base/aimath/aimath_q31.h</a>&quot;</span></div>
<div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160; </div>
<div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;<span class="preprocessor">#define DENSE_WEIGHTS_SIZE(INPUTS, OUTPUTS)     ((INPUTS) * (OUTPUTS))</span></div>
<div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;<span class="preprocessor">#define DENSE_BIAS_SIZE(OUTPUTS)                (OUTPUTS)</span></div>
<div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160; </div>
<div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;<span class="preprocessor">#define DENSE_WEIGHTS_SHAPE(INPUTS, OUTPUTS)    {INPUTS, OUTPUTS}</span></div>
<div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;<span class="preprocessor">#define DENSE_BIAS_SHAPE(OUTPUTS)               {1, OUTPUTS}</span></div>
<div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160; </div>
<div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;<span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="structailayer__dense.html">ailayer_dense</a>    <a class="code" href="structailayer__dense.html">ailayer_dense_t</a>;</div>
<div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160; </div>
<div class="line"><a name="l00071"></a><span class="lineno"><a class="line" href="structailayer__dense.html">   71</a></span>&#160;<span class="keyword">struct </span><a class="code" href="structailayer__dense.html">ailayer_dense</a> {</div>
<div class="line"><a name="l00072"></a><span class="lineno"><a class="line" href="structailayer__dense.html#ab13782a46e3804246bf82a92955096b3">   72</a></span>&#160;    <a class="code" href="structailayer.html">ailayer_t</a> <a class="code" href="structailayer__dense.html#ab13782a46e3804246bf82a92955096b3">base</a>; </div>
<div class="line"><a name="l00080"></a><span class="lineno"><a class="line" href="structailayer__dense.html#aa7ae0d08cc0a75b22e656b9e2e3c336b">   80</a></span>&#160;    uint32_t <a class="code" href="structailayer__dense.html#aa7ae0d08cc0a75b22e656b9e2e3c336b">neurons</a>; </div>
<div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160; </div>
<div class="line"><a name="l00087"></a><span class="lineno"><a class="line" href="structailayer__dense.html#abaaf545fb7c9d3a0b80aa5a460202e04">   87</a></span>&#160;    <a class="code" href="structaitensor.html">aitensor_t</a> <a class="code" href="structailayer__dense.html#abaaf545fb7c9d3a0b80aa5a460202e04">weights</a>; </div>
<div class="line"><a name="l00088"></a><span class="lineno"><a class="line" href="structailayer__dense.html#a87664225b3b1ad7ec4cb74cc8bd8f349">   88</a></span>&#160;    <a class="code" href="structaitensor.html">aitensor_t</a> <a class="code" href="structailayer__dense.html#a87664225b3b1ad7ec4cb74cc8bd8f349">bias</a>; </div>
<div class="line"><a name="l00090"></a><span class="lineno"><a class="line" href="structailayer__dense.html#a055e3841d49ce4e2d8c52f4bf4536641">   90</a></span>&#160;    uint16_t <a class="code" href="structailayer__dense.html#a055e3841d49ce4e2d8c52f4bf4536641">weights_shape</a>[2]; </div>
<div class="line"><a name="l00091"></a><span class="lineno"><a class="line" href="structailayer__dense.html#a2f0b1dbeba330cf6ef798b0f91cd0a80">   91</a></span>&#160;    uint16_t <a class="code" href="structailayer__dense.html#a2f0b1dbeba330cf6ef798b0f91cd0a80">bias_shape</a>[1]; </div>
<div class="line"><a name="l00093"></a><span class="lineno"><a class="line" href="structailayer__dense.html#afcc6c64ff572ae7408fe1c4bcfe7b9d1">   93</a></span>&#160;    <a class="code" href="structaitensor.html">aitensor_t</a> *<a class="code" href="structailayer__dense.html#afcc6c64ff572ae7408fe1c4bcfe7b9d1">trainable_params</a>[2]; </div>
<div class="line"><a name="l00094"></a><span class="lineno"><a class="line" href="structailayer__dense.html#a33b189c78566d57ad498dbf2cc364917">   94</a></span>&#160;    <a class="code" href="structaitensor.html">aitensor_t</a> *<a class="code" href="structailayer__dense.html#a33b189c78566d57ad498dbf2cc364917">gradients</a>[2]; </div>
<div class="line"><a name="l00095"></a><span class="lineno"><a class="line" href="structailayer__dense.html#a590c48e998a8a740439e38d0aa4302dd">   95</a></span>&#160;    <span class="keywordtype">void</span> *<a class="code" href="structailayer__dense.html#a590c48e998a8a740439e38d0aa4302dd">optimem</a>[2]; </div>
<div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160; </div>
<div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160; </div>
<div class="line"><a name="l00115"></a><span class="lineno"><a class="line" href="structailayer__dense.html#a7218a352357b1fb602775252d8286ce6">  115</a></span>&#160;    void (*<a class="code" href="structailayer__dense.html#a7218a352357b1fb602775252d8286ce6">linear</a>)(<span class="keyword">const</span> <a class="code" href="structaitensor.html">aitensor_t</a> *a, <span class="keyword">const</span> <a class="code" href="structaitensor.html">aitensor_t</a> *b, <span class="keyword">const</span> <a class="code" href="structaitensor.html">aitensor_t</a> *c, <a class="code" href="structaitensor.html">aitensor_t</a> *result);</div>
<div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160; </div>
<div class="line"><a name="l00128"></a><span class="lineno"><a class="line" href="structailayer__dense.html#aa401e714d435b2673670e3be35da33c1">  128</a></span>&#160;    void (*<a class="code" href="structailayer__dense.html#aa401e714d435b2673670e3be35da33c1">mat_mul_at</a>)(<span class="keyword">const</span> <a class="code" href="structaitensor.html">aitensor_t</a> *a, <span class="keyword">const</span> <a class="code" href="structaitensor.html">aitensor_t</a> *b, <a class="code" href="structaitensor.html">aitensor_t</a> *result);</div>
<div class="line"><a name="l00129"></a><span class="lineno">  129</span>&#160; </div>
<div class="line"><a name="l00141"></a><span class="lineno"><a class="line" href="structailayer__dense.html#a422118d4ddc5559465a4a411dc20bcb5">  141</a></span>&#160;    void (*<a class="code" href="structailayer__dense.html#a422118d4ddc5559465a4a411dc20bcb5">mat_mul_bt</a>)(<span class="keyword">const</span> <a class="code" href="structaitensor.html">aitensor_t</a> *a, <span class="keyword">const</span> <a class="code" href="structaitensor.html">aitensor_t</a> *b, <a class="code" href="structaitensor.html">aitensor_t</a> *result);</div>
<div class="line"><a name="l00142"></a><span class="lineno">  142</span>&#160; </div>
<div class="line"><a name="l00150"></a><span class="lineno"><a class="line" href="structailayer__dense.html#a7674445f16490c6cacdb03157feab8c7">  150</a></span>&#160;    void (*<a class="code" href="structailayer__dense.html#a7674445f16490c6cacdb03157feab8c7">tensor_add</a>)(<span class="keyword">const</span> <a class="code" href="structaitensor.html">aitensor_t</a> *a, <span class="keyword">const</span> <a class="code" href="structaitensor.html">aitensor_t</a> *b, <a class="code" href="structaitensor.html">aitensor_t</a> *result);</div>
<div class="line"><a name="l00151"></a><span class="lineno">  151</span>&#160; </div>
<div class="line"><a name="l00159"></a><span class="lineno"><a class="line" href="structailayer__dense.html#a4c1ea5c9637a2a0d708442e852bba4ab">  159</a></span>&#160;    void (*<a class="code" href="structailayer__dense.html#a4c1ea5c9637a2a0d708442e852bba4ab">sum_channelwise</a>)(<span class="keyword">const</span> <a class="code" href="structaitensor.html">aitensor_t</a> *a, int8_t channel_axis, <a class="code" href="structaitensor.html">aitensor_t</a> *result);</div>
<div class="line"><a name="l00160"></a><span class="lineno">  160</span>&#160; </div>
<div class="line"><a name="l00162"></a><span class="lineno">  162</span>&#160; </div>
<div class="line"><a name="l00163"></a><span class="lineno"><a class="line" href="structailayer__dense.html#ab733a6d9451ea97c43c593a495f26d51">  163</a></span>&#160;    uint16_t <a class="code" href="structailayer__dense.html#ab733a6d9451ea97c43c593a495f26d51">result_shape</a>[2]; </div>
<div class="line"><a name="l00164"></a><span class="lineno">  164</span>&#160;};</div>
<div class="line"><a name="l00165"></a><span class="lineno">  165</span>&#160; </div>
<div class="line"><a name="l00171"></a><span class="lineno">  171</span>&#160;<span class="keyword">extern</span> <span class="keyword">const</span> <a class="code" href="structaicore__layertype.html">aicore_layertype_t</a> *<a class="code" href="ailayer__dense_8h.html#a1746227a13e65de07c7b7be8a0b8e8f8">ailayer_dense_type</a>;</div>
<div class="line"><a name="l00172"></a><span class="lineno">  172</span>&#160; </div>
<div class="line"><a name="l00184"></a><span class="lineno"><a class="line" href="ailayer__dense_8h.html#a55f934a56796ad95ed1c84872a60036a">  184</a></span>&#160;<a class="code" href="structailayer.html">ailayer_t</a> *<a class="code" href="ailayer__dense_8h.html#a55f934a56796ad95ed1c84872a60036a">ailayer_dense</a>(<a class="code" href="structailayer__dense.html">ailayer_dense_t</a> *layer, <a class="code" href="structailayer.html">ailayer_t</a> *input_layer);</div>
<div class="line"><a name="l00185"></a><span class="lineno">  185</span>&#160; </div>
<div class="line"><a name="l00208"></a><span class="lineno"><a class="line" href="ailayer__dense_8h.html#a60a37f3b0d587837a4009493358a9099">  208</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="ailayer__dense_8h.html#a60a37f3b0d587837a4009493358a9099">ailayer_dense_forward</a>(<a class="code" href="structailayer.html">ailayer_t</a> *<span class="keyword">self</span>);</div>
<div class="line"><a name="l00209"></a><span class="lineno">  209</span>&#160; </div>
<div class="line"><a name="l00246"></a><span class="lineno"><a class="line" href="ailayer__dense_8h.html#a5e277ec1fb19ee7bf5ff5739e1ff602b">  246</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="ailayer__dense_8h.html#a5e277ec1fb19ee7bf5ff5739e1ff602b">ailayer_dense_backward</a>(<a class="code" href="structailayer.html">ailayer_t</a> *<span class="keyword">self</span>);</div>
<div class="line"><a name="l00247"></a><span class="lineno">  247</span>&#160; </div>
<div class="line"><a name="l00256"></a><span class="lineno"><a class="line" href="ailayer__dense_8h.html#af5b9c869c1fa531d97c4552260a281bb">  256</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="ailayer__dense_8h.html#af5b9c869c1fa531d97c4552260a281bb">ailayer_dense_calc_result_shape</a>(<a class="code" href="structailayer.html">ailayer_t</a> *<span class="keyword">self</span>);</div>
<div class="line"><a name="l00257"></a><span class="lineno">  257</span>&#160; </div>
<div class="line"><a name="l00258"></a><span class="lineno">  258</span>&#160;uint32_t ailayer_dense_sizeof_bwdmem(<span class="keyword">const</span> <a class="code" href="structailayer.html">ailayer_t</a> *<span class="keyword">self</span>);</div>
<div class="line"><a name="l00259"></a><span class="lineno">  259</span>&#160; </div>
<div class="line"><a name="l00270"></a><span class="lineno"><a class="line" href="ailayer__dense_8h.html#acbf46397f7de94812d143bce76e242e9">  270</a></span>&#160;uint32_t <a class="code" href="ailayer__dense_8h.html#acbf46397f7de94812d143bce76e242e9">ailayer_dense_sizeof_paramem</a>(<span class="keyword">const</span> <a class="code" href="structailayer.html">ailayer_t</a> *<span class="keyword">self</span>);</div>
<div class="line"><a name="l00271"></a><span class="lineno">  271</span>&#160; </div>
<div class="line"><a name="l00283"></a><span class="lineno"><a class="line" href="ailayer__dense_8h.html#a53080c62efc7018b712b45cf12b1752c">  283</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="ailayer__dense_8h.html#a53080c62efc7018b712b45cf12b1752c">ailayer_dense_set_paramem</a>(<a class="code" href="structailayer.html">ailayer_t</a> *<span class="keyword">self</span>, <span class="keywordtype">void</span> *memory_ptr);</div>
<div class="line"><a name="l00284"></a><span class="lineno">  284</span>&#160; </div>
<div class="line"><a name="l00294"></a><span class="lineno"><a class="line" href="ailayer__dense_8h.html#a805ebc0bc547e269a66cda967d6cf078">  294</a></span>&#160;uint32_t <a class="code" href="ailayer__dense_8h.html#a805ebc0bc547e269a66cda967d6cf078">ailayer_dense_sizeof_trainmem</a>(<span class="keyword">const</span> <a class="code" href="structailayer.html">ailayer_t</a> *<span class="keyword">self</span>);</div>
<div class="line"><a name="l00295"></a><span class="lineno">  295</span>&#160; </div>
<div class="line"><a name="l00305"></a><span class="lineno"><a class="line" href="ailayer__dense_8h.html#a6958d4d1d0e04b3956439d376eba68a6">  305</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="ailayer__dense_8h.html#a6958d4d1d0e04b3956439d376eba68a6">ailayer_dense_set_trainmem</a>(<a class="code" href="structailayer.html">ailayer_t</a> *<span class="keyword">self</span>, <span class="keywordtype">void</span> *memory_ptr);</div>
<div class="line"><a name="l00306"></a><span class="lineno">  306</span>&#160; </div>
<div class="line"><a name="l00307"></a><span class="lineno">  307</span>&#160;<span class="preprocessor">#ifdef AIDEBUG_PRINT_MODULE_SPECS</span></div>
<div class="line"><a name="l00312"></a><span class="lineno"><a class="line" href="ailayer__dense_8h.html#a24f794b27b7f95f1d7bb37d3d644709b">  312</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="ailayer__dense_8h.html#a24f794b27b7f95f1d7bb37d3d644709b">ailayer_dense_print_specs</a>(<span class="keyword">const</span> <a class="code" href="structailayer.html">ailayer_t</a> *<span class="keyword">self</span>);</div>
<div class="line"><a name="l00313"></a><span class="lineno">  313</span>&#160;<span class="preprocessor">#endif </span><span class="comment">// AIDEBUG_PRINT_MODULE_SPECS</span></div>
<div class="line"><a name="l00314"></a><span class="lineno">  314</span>&#160; </div>
<div class="line"><a name="l00315"></a><span class="lineno">  315</span>&#160;<span class="preprocessor">#endif </span><span class="comment">// AILAYER_DENSE</span></div>
<div class="ttc" id="aaifes__core_8h_html"><div class="ttname"><a href="aifes__core_8h.html">aifes_core.h</a></div><div class="ttdoc">AIfES 2 core interface.</div></div>
<div class="ttc" id="aailayer__dense_8h_html_a1746227a13e65de07c7b7be8a0b8e8f8"><div class="ttname"><a href="ailayer__dense_8h.html#a1746227a13e65de07c7b7be8a0b8e8f8">ailayer_dense_type</a></div><div class="ttdeci">const aicore_layertype_t * ailayer_dense_type</div><div class="ttdoc">Dense layer type.</div></div>
<div class="ttc" id="aailayer__dense_8h_html_a24f794b27b7f95f1d7bb37d3d644709b"><div class="ttname"><a href="ailayer__dense_8h.html#a24f794b27b7f95f1d7bb37d3d644709b">ailayer_dense_print_specs</a></div><div class="ttdeci">void ailayer_dense_print_specs(const ailayer_t *self)</div><div class="ttdoc">Print the layer specification.</div></div>
<div class="ttc" id="aailayer__dense_8h_html_a53080c62efc7018b712b45cf12b1752c"><div class="ttname"><a href="ailayer__dense_8h.html#a53080c62efc7018b712b45cf12b1752c">ailayer_dense_set_paramem</a></div><div class="ttdeci">void ailayer_dense_set_paramem(ailayer_t *self, void *memory_ptr)</div><div class="ttdoc">Distribute provided memory to the parameter pointers.</div></div>
<div class="ttc" id="aailayer__dense_8h_html_a55f934a56796ad95ed1c84872a60036a"><div class="ttname"><a href="ailayer__dense_8h.html#a55f934a56796ad95ed1c84872a60036a">ailayer_dense</a></div><div class="ttdeci">ailayer_t * ailayer_dense(ailayer_dense_t *layer, ailayer_t *input_layer)</div><div class="ttdoc">Initialize and connect the given Dense layer.</div></div>
<div class="ttc" id="aailayer__dense_8h_html_a5e277ec1fb19ee7bf5ff5739e1ff602b"><div class="ttname"><a href="ailayer__dense_8h.html#a5e277ec1fb19ee7bf5ff5739e1ff602b">ailayer_dense_backward</a></div><div class="ttdeci">void ailayer_dense_backward(ailayer_t *self)</div><div class="ttdoc">Calculate the backward pass for the given Dense layer.</div></div>
<div class="ttc" id="aailayer__dense_8h_html_a60a37f3b0d587837a4009493358a9099"><div class="ttname"><a href="ailayer__dense_8h.html#a60a37f3b0d587837a4009493358a9099">ailayer_dense_forward</a></div><div class="ttdeci">void ailayer_dense_forward(ailayer_t *self)</div><div class="ttdoc">Calculate the forward pass for given Dense layer.</div></div>
<div class="ttc" id="aailayer__dense_8h_html_a6958d4d1d0e04b3956439d376eba68a6"><div class="ttname"><a href="ailayer__dense_8h.html#a6958d4d1d0e04b3956439d376eba68a6">ailayer_dense_set_trainmem</a></div><div class="ttdeci">void ailayer_dense_set_trainmem(ailayer_t *self, void *memory_ptr)</div><div class="ttdoc">Distribute provided memory to the gradients pointers.</div></div>
<div class="ttc" id="aailayer__dense_8h_html_a805ebc0bc547e269a66cda967d6cf078"><div class="ttname"><a href="ailayer__dense_8h.html#a805ebc0bc547e269a66cda967d6cf078">ailayer_dense_sizeof_trainmem</a></div><div class="ttdeci">uint32_t ailayer_dense_sizeof_trainmem(const ailayer_t *self)</div><div class="ttdoc">Calculate and return the memory size needed by this layer for training.</div></div>
<div class="ttc" id="aailayer__dense_8h_html_acbf46397f7de94812d143bce76e242e9"><div class="ttname"><a href="ailayer__dense_8h.html#acbf46397f7de94812d143bce76e242e9">ailayer_dense_sizeof_paramem</a></div><div class="ttdeci">uint32_t ailayer_dense_sizeof_paramem(const ailayer_t *self)</div><div class="ttdoc">Calculate and return the parameter memory size needed for this layer.</div></div>
<div class="ttc" id="aailayer__dense_8h_html_af5b9c869c1fa531d97c4552260a281bb"><div class="ttname"><a href="ailayer__dense_8h.html#af5b9c869c1fa531d97c4552260a281bb">ailayer_dense_calc_result_shape</a></div><div class="ttdeci">void ailayer_dense_calc_result_shape(ailayer_t *self)</div><div class="ttdoc">Calculate the shape of the result tensor (ailayer.result)</div></div>
<div class="ttc" id="aaimath__f32__default_8h_html"><div class="ttname"><a href="aimath__f32__default_8h.html">aimath_f32_default.h</a></div><div class="ttdoc">Math functions for F32  data type, default implementation.</div></div>
<div class="ttc" id="aaimath__q31_8h_html"><div class="ttname"><a href="aimath__q31_8h.html">aimath_q31.h</a></div><div class="ttdoc">Definition of the Q31 (aiq31) data-type.</div></div>
<div class="ttc" id="aaimath__q7__default_8h_html"><div class="ttname"><a href="aimath__q7__default_8h.html">aimath_q7_default.h</a></div><div class="ttdoc">Math functions for Q7  data type, default implementation.</div></div>
<div class="ttc" id="astructaicore__layertype_html"><div class="ttname"><a href="structaicore__layertype.html">aicore_layertype</a></div><div class="ttdoc">Type indicator of the layer.</div><div class="ttdef"><b>Definition:</b> aifes_core.h:82</div></div>
<div class="ttc" id="astructailayer__dense_html"><div class="ttname"><a href="structailayer__dense.html">ailayer_dense</a></div><div class="ttdoc">General Dense layer  structure.</div><div class="ttdef"><b>Definition:</b> ailayer_dense.h:71</div></div>
<div class="ttc" id="astructailayer__dense_html_a055e3841d49ce4e2d8c52f4bf4536641"><div class="ttname"><a href="structailayer__dense.html#a055e3841d49ce4e2d8c52f4bf4536641">ailayer_dense::weights_shape</a></div><div class="ttdeci">uint16_t weights_shape[2]</div><div class="ttdoc">Weights tensor shape (n x m matrix).</div><div class="ttdef"><b>Definition:</b> ailayer_dense.h:90</div></div>
<div class="ttc" id="astructailayer__dense_html_a2f0b1dbeba330cf6ef798b0f91cd0a80"><div class="ttname"><a href="structailayer__dense.html#a2f0b1dbeba330cf6ef798b0f91cd0a80">ailayer_dense::bias_shape</a></div><div class="ttdeci">uint16_t bias_shape[1]</div><div class="ttdoc">Bias weights tensor shape (n x m matrix).</div><div class="ttdef"><b>Definition:</b> ailayer_dense.h:91</div></div>
<div class="ttc" id="astructailayer__dense_html_a33b189c78566d57ad498dbf2cc364917"><div class="ttname"><a href="structailayer__dense.html#a33b189c78566d57ad498dbf2cc364917">ailayer_dense::gradients</a></div><div class="ttdeci">aitensor_t * gradients[2]</div><div class="ttdoc">Gradients structure for the back propagation algorithm.</div><div class="ttdef"><b>Definition:</b> ailayer_dense.h:94</div></div>
<div class="ttc" id="astructailayer__dense_html_a422118d4ddc5559465a4a411dc20bcb5"><div class="ttname"><a href="structailayer__dense.html#a422118d4ddc5559465a4a411dc20bcb5">ailayer_dense::mat_mul_bt</a></div><div class="ttdeci">void(* mat_mul_bt)(const aitensor_t *a, const aitensor_t *b, aitensor_t *result)</div><div class="ttdoc">Required math function: Matrix multiplication with transposed b.</div><div class="ttdef"><b>Definition:</b> ailayer_dense.h:141</div></div>
<div class="ttc" id="astructailayer__dense_html_a4c1ea5c9637a2a0d708442e852bba4ab"><div class="ttname"><a href="structailayer__dense.html#a4c1ea5c9637a2a0d708442e852bba4ab">ailayer_dense::sum_channelwise</a></div><div class="ttdeci">void(* sum_channelwise)(const aitensor_t *a, int8_t channel_axis, aitensor_t *result)</div><div class="ttdoc">Required math function: Channel-wise sum.</div><div class="ttdef"><b>Definition:</b> ailayer_dense.h:159</div></div>
<div class="ttc" id="astructailayer__dense_html_a590c48e998a8a740439e38d0aa4302dd"><div class="ttname"><a href="structailayer__dense.html#a590c48e998a8a740439e38d0aa4302dd">ailayer_dense::optimem</a></div><div class="ttdeci">void * optimem[2]</div><div class="ttdoc">Memory field used by the trainings optimizer.</div><div class="ttdef"><b>Definition:</b> ailayer_dense.h:95</div></div>
<div class="ttc" id="astructailayer__dense_html_a7218a352357b1fb602775252d8286ce6"><div class="ttname"><a href="structailayer__dense.html#a7218a352357b1fb602775252d8286ce6">ailayer_dense::linear</a></div><div class="ttdeci">void(* linear)(const aitensor_t *a, const aitensor_t *b, const aitensor_t *c, aitensor_t *result)</div><div class="ttdoc">Required math function: Linear transformation.</div><div class="ttdef"><b>Definition:</b> ailayer_dense.h:115</div></div>
<div class="ttc" id="astructailayer__dense_html_a7674445f16490c6cacdb03157feab8c7"><div class="ttname"><a href="structailayer__dense.html#a7674445f16490c6cacdb03157feab8c7">ailayer_dense::tensor_add</a></div><div class="ttdeci">void(* tensor_add)(const aitensor_t *a, const aitensor_t *b, aitensor_t *result)</div><div class="ttdoc">Required math function: Element wise tensor addition.</div><div class="ttdef"><b>Definition:</b> ailayer_dense.h:150</div></div>
<div class="ttc" id="astructailayer__dense_html_a87664225b3b1ad7ec4cb74cc8bd8f349"><div class="ttname"><a href="structailayer__dense.html#a87664225b3b1ad7ec4cb74cc8bd8f349">ailayer_dense::bias</a></div><div class="ttdeci">aitensor_t bias</div><div class="ttdoc">Tensor containing the layer bias weights.</div><div class="ttdef"><b>Definition:</b> ailayer_dense.h:88</div></div>
<div class="ttc" id="astructailayer__dense_html_aa401e714d435b2673670e3be35da33c1"><div class="ttname"><a href="structailayer__dense.html#aa401e714d435b2673670e3be35da33c1">ailayer_dense::mat_mul_at</a></div><div class="ttdeci">void(* mat_mul_at)(const aitensor_t *a, const aitensor_t *b, aitensor_t *result)</div><div class="ttdoc">Required math function: Matrix multiplication with transposed a.</div><div class="ttdef"><b>Definition:</b> ailayer_dense.h:128</div></div>
<div class="ttc" id="astructailayer__dense_html_aa7ae0d08cc0a75b22e656b9e2e3c336b"><div class="ttname"><a href="structailayer__dense.html#aa7ae0d08cc0a75b22e656b9e2e3c336b">ailayer_dense::neurons</a></div><div class="ttdeci">uint32_t neurons</div><div class="ttdoc">Layer neurons count (number of outputs).</div><div class="ttdef"><b>Definition:</b> ailayer_dense.h:80</div></div>
<div class="ttc" id="astructailayer__dense_html_ab13782a46e3804246bf82a92955096b3"><div class="ttname"><a href="structailayer__dense.html#ab13782a46e3804246bf82a92955096b3">ailayer_dense::base</a></div><div class="ttdeci">ailayer_t base</div><div class="ttdoc">Inherited field members from general ailayer struct.</div><div class="ttdef"><b>Definition:</b> ailayer_dense.h:72</div></div>
<div class="ttc" id="astructailayer__dense_html_ab733a6d9451ea97c43c593a495f26d51"><div class="ttname"><a href="structailayer__dense.html#ab733a6d9451ea97c43c593a495f26d51">ailayer_dense::result_shape</a></div><div class="ttdeci">uint16_t result_shape[2]</div><div class="ttdoc">Inference result tensor (ailayer.result) shape.</div><div class="ttdef"><b>Definition:</b> ailayer_dense.h:163</div></div>
<div class="ttc" id="astructailayer__dense_html_abaaf545fb7c9d3a0b80aa5a460202e04"><div class="ttname"><a href="structailayer__dense.html#abaaf545fb7c9d3a0b80aa5a460202e04">ailayer_dense::weights</a></div><div class="ttdeci">aitensor_t weights</div><div class="ttdoc">Tensor containing the layer weights.</div><div class="ttdef"><b>Definition:</b> ailayer_dense.h:87</div></div>
<div class="ttc" id="astructailayer__dense_html_afcc6c64ff572ae7408fe1c4bcfe7b9d1"><div class="ttname"><a href="structailayer__dense.html#afcc6c64ff572ae7408fe1c4bcfe7b9d1">ailayer_dense::trainable_params</a></div><div class="ttdeci">aitensor_t * trainable_params[2]</div><div class="ttdoc">Pointer to the weights and biases (which are the trainable parameters).</div><div class="ttdef"><b>Definition:</b> ailayer_dense.h:93</div></div>
<div class="ttc" id="astructailayer_html"><div class="ttname"><a href="structailayer.html">ailayer</a></div><div class="ttdoc">AIfES layer interface.</div><div class="ttdef"><b>Definition:</b> aifes_core.h:252</div></div>
<div class="ttc" id="astructaitensor_html"><div class="ttname"><a href="structaitensor.html">aitensor</a></div><div class="ttdoc">A tensor in AIfES.</div><div class="ttdef"><b>Definition:</b> aifes_math.h:89</div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li><li class="navelem"><a class="el" href="dir_1e5d3661ed79af157d57e64a38265d09.html">basic</a></li><li class="navelem"><a class="el" href="dir_90008ee2b0f86999412b56217da88d54.html">base</a></li><li class="navelem"><a class="el" href="dir_ad1f3f314a3dbbd36ea1eb350865d78d.html">ailayer</a></li><li class="navelem"><a class="el" href="ailayer__dense_8h.html">ailayer_dense.h</a></li>
    <li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1 </li>
  </ul>
</div>
</body>
</html>
